﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Room.ascx.cs" Inherits="Hotel.UserControls.Room" %>


<asp:GridView ID="gvpayment" runat="server" CellPadding="0" CellSpacing="0" HeaderStyle-BackColor="#EAEAEA"
    AutoGenerateColumns="false" CssClass="grid" AlternatingRowStyle-CssClass="gridAltRow"
    RowStyle-CssClass="gridRow" ShowFooter="True" EditRowStyle-CssClass="gridEditRow"
    FooterStyle-CssClass="gridFooterRow" OnRowCancelingEdit="gvpayment_RowCancelingEdit"
    OnRowCommand="gvpayment_RowCommand" OnRowDeleting="gvpayment_RowDeleting" OnRowUpdating="gvpayment_RowUpdating"
    DataKeyNames="RoomId" OnRowEditing="gvpayment_RowEditing"
    OnRowCreated="gvpayment_RowCreated" OnRowDataBound="gvpayment_RowDataBound">
    <AlternatingRowStyle CssClass="gridAltRow"></AlternatingRowStyle>
    <Columns>
        <asp:TemplateField HeaderText="Room No" HeaderStyle-HorizontalAlign="Left">
            <ItemTemplate>
                <asp:Label ID="lblName" runat="server" Text='<%# Eval("RoomNumber") %>' Width="250"></asp:Label>
            </ItemTemplate>
            <EditItemTemplate>
                <asp:TextBox ID="txtName" runat="server" Text='<%# Bind("RoomNumber") %>' CssClass="textbox"
                    Width="250"></asp:TextBox>
                <asp:RequiredFieldValidator ID="txtNameIRq" runat="server" ErrorMessage="Room Number is Required"
                    SetFocusOnError="true"
                    ControlToValidate="txtName" ValidationGroup="Update" Display="None"></asp:RequiredFieldValidator>
            </EditItemTemplate>
            <FooterTemplate>
                <asp:TextBox ID="txtNameNew" runat="server" CssClass="textbox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="txtNameIRq" runat="server" ErrorMessage="Room Number is Required"
                    SetFocusOnError="true"
                    ControlToValidate="txtNameNew" ValidationGroup="Insert" Display="None"></asp:RequiredFieldValidator>
            </FooterTemplate>

            <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="RoomType" HeaderStyle-HorizontalAlign="Left">
            <ItemTemplate>
                <asp:Label ID="LblRoomType" runat="server" Text='<%# Eval("RoomType") %>'></asp:Label>
            </ItemTemplate>
            <EditItemTemplate>
                <asp:DropDownList ID="dlRoomType" runat="server"
                    DataTextField="RoomType" DataValueField="RoomTypeId">
                </asp:DropDownList>
                <asp:Label ID="lRoomType" runat="server" Text='<%# Eval("RoomType") %>'
                    Visible="false"></asp:Label>
            </EditItemTemplate>
            <FooterTemplate>
                <asp:DropDownList ID="ddlRoomType" runat="server"
                    DataTextField="RoomType" DataValueField="RoomTypeId">
                </asp:DropDownList>



                <%-- <asp:TextBox ID="txtRoomType" runat="server" CssClass="textbox" Width="250"></asp:TextBox>--%>
            </FooterTemplate>

            <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Under Room Service" HeaderStyle-HorizontalAlign="Left">
            <ItemTemplate>
                <asp:CheckBox ID="ChkS" runat="server" Checked='<%# Eval("IsUnderRoomService") %>'
                    Enabled="false"></asp:CheckBox>
            </ItemTemplate>
            <EditItemTemplate>
                <asp:CheckBox ID="chkservice" runat="server" Checked='<%# Bind("IsUnderRoomService") %>' />
            </EditItemTemplate>
            <FooterTemplate>
                <asp:CheckBox ID="chkserviceinsert" runat="server" />
            </FooterTemplate>

            <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
        </asp:TemplateField>
        <asp:TemplateField ShowHeader="False" HeaderStyle-HorizontalAlign="Left">
            <EditItemTemplate>
                <asp:LinkButton ID="lnkUpdate" runat="server" CausesValidation="True" CommandName="Update"
                    Text="Update" OnClientClick="return confirm('Update?')" ValidationGroup="Update"></asp:LinkButton>
                <asp:ValidationSummary ID="vsUpdate" runat="server" ShowMessageBox="true" ShowSummary="false"
                    ValidationGroup="Update" Enabled="true" HeaderText="" />
                <asp:LinkButton ID="lnkCancel" runat="server" CausesValidation="False" CommandName="Cancel"
                    Text="Cancel"></asp:LinkButton>
            </EditItemTemplate>
            <FooterTemplate>
                <asp:LinkButton ID="lnkAdd" runat="server" CausesValidation="True" CommandName="Insert"
                    ValidationGroup="Insert" Text="Add"></asp:LinkButton>
                <asp:ValidationSummary ID="vsInsert" runat="server" ShowMessageBox="true" ShowSummary="false"
                    ValidationGroup="Insert" Enabled="true" HeaderText="" />
            </FooterTemplate>
            <ItemTemplate>
                <asp:LinkButton ID="lnkEdit" runat="server" CausesValidation="False" CommandName="Edit"
                    Text="Edit"></asp:LinkButton>
            </ItemTemplate>
            <HeaderStyle HorizontalAlign="Left" />
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Delete" ShowHeader="False" HeaderStyle-HorizontalAlign="Left"
            Visible="false">
            <ItemTemplate>
                <asp:LinkButton ID="lnkDelete" runat="server" CausesValidation="False" CommandName="Delete"
                    Text="Delete" OnClientClick="return confirm('Delete?')"></asp:LinkButton>
            </ItemTemplate>
            <HeaderStyle HorizontalAlign="Left" />
        </asp:TemplateField>
    </Columns>

    <EditRowStyle CssClass="gridEditRow"></EditRowStyle>
    <EmptyDataTemplate>
    </EmptyDataTemplate>

    <FooterStyle CssClass="gridFooterRow"></FooterStyle>

    <HeaderStyle BackColor="#EAEAEA"></HeaderStyle>

    <RowStyle CssClass="gridRow"></RowStyle>
</asp:GridView>

